<div id="content">
	<div class="content-bg">
		<!-- start block -->
		<div class="big-block">
		
			<!--<h1><?php echo Kohana::lang('ui_main.alerts_get'); ?></h1>-->
			<?php
			if ($form_error) {
			?>
			<!-- red-box -->
			<div class="red-box">
				<h3>Error!</h3>
				<ul>
					<?php
					foreach ($errors as $error_item => $error_description)
					{
					// print "<li>" . $error_description . "</li>";
					print (!$error_description) ? '' : "<li>" . $error_description . "</li>";
					}
					?>
				</ul>
			</div>
			<?php
			}
			?>
			<? print form::open('/alerts');?>
			<div class="step-1" style="width:447px;">
				<span class="floating-dropcap">1</span>
				<h2><?php echo Kohana::lang('ui_main.alerts_step1_select_city'); ?></h2>
				<small>
					<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<?php echo "<span style=\"color:red;\">* ".Kohana::lang('ui_main.radio')."</span>"; ?>
				</small> 
				<div class="map" style="margin-left:17px;height:330px;width:448px;">
					<div class="map-holder" id="divMap"></div>
				</div>
				<div class="report-find-location" style="margin-left:17px;width:450px;">
					<div class="alert_slider">
						<select name="alert_radius" id="alert_radius">
							<option value="3">3 KM</option>
							<option value="6" selected="selected">6 KM</option>
							<option value="9">9 KM</option>
							<option value="12">12 KM</option>
							<option value="15">15 KM</option>
							<option value="18">18 KM</option>
						</select>
					</div>
					<?php
						if ($allow_feed == 1 )
						{
					?>
                    <div class="feed">
                        <h2><?php echo Kohana::lang('ui_main.alerts_rss'); ?></h2>
                        <div class="holder">
                            <div class="box" style="text-align:center;">
                                <a href="<?php echo url::site(); ?>feed/"><img src="<?php echo url::base(); ?>media/img/icon-feed.png" style="vertical-align: middle;" border="0"></a>&nbsp;<strong style="font-size:160%;"><a href="<?php echo url::site(); ?>feed/"><?php echo url::site(); ?>feed/</a></strong>
                            </div>
                        </div>
                    </div>
					<?php
                        }
                    ?>
					<!--<?php print form::input('location_find', '', ' title="City, State and/or Country" class="findtext"'); ?>
					<div style="float:left;margin:9px 0 0 5px;"><input type="button" name="button" id="button" value="<?php echo Kohana::lang('ui_main.find_location'); ?>" class="btn_find" /></div>
					<div id="find_loading" class="report-find-loading"></div>
					<div style="clear:both;" id="find_text">* <?php echo Kohana::lang('ui_main.alerts_place_spot2'); ?></div>-->
				</div>
			</div>
			<input type="hidden" id="alert_lat" name="alert_lat" value="<?php echo $form['alert_lat']; ?>">
			<input type="hidden" id="alert_lon" name="alert_lon" value="<?php echo $form['alert_lon']; ?>">
			<div class="step-2-holder">
				<div class="step-2">
					<span class="floating-dropcap">2</span>
					<h2>
						<?php echo Kohana::lang('ui_main.alerts_step2_send_alerts'); ?>
						<sup style="color:red;font-size:55%;">
							&nbsp;(1)
						</sup> 
					</h2>
					<div class="holder">
						<?php if($show_mobile == true) { ?>
						<div class="box">
							<label>
								<?php
									if ($form['alert_mobile_yes'] == 1) {
										$checked = true;
									}
									else
									{
									 	$checked = false;
									}
									print form::checkbox('alert_mobile_yes', '1', $checked);
								?>
								<span class="texthint" title="<?php echo Kohana::lang('ui_main.warning'); ?>">
									<strong>
										<?php echo Kohana::lang('ui_main.alerts_mobile_phone'); ?>
									</strong>
									<br>
									<?php echo Kohana::lang('ui_main.alerts_enter_mobile'); ?>&nbsp;
								</span>
								<small>
									<br>
									<?php echo "<span style=\"color:red;\">".Kohana::lang('ui_main.mobil_example')."</span>"; ?>
								</small> 
							</label>
							<span><?php print form::input('alert_mobile', $form['alert_mobile'], ' title="'.Kohana::lang('ui_main.sms_example').'"maxlength=10 onkeyup="if(isNaN(this.value)){this.value=this.value.substring(0,this.value.lenght-1)}" class="text long texthint"'); ?></span>
						</div>
						<?php } ?>
						<div class="box">
							<label>
								<?php
									if ($form['alert_email_yes'] == 1) {
										$checked = true;
									}
									else
									{
										$checked = false;
									}
									print form::checkbox('alert_email_yes', '1', $checked);
								?>
								<span>
									<strong>
										<?php echo Kohana::lang('ui_main.alerts_email'); ?>
									</strong>
									<br>
									<?php echo Kohana::lang('ui_main.alerts_enter_email'); ?>
								</span>
								<small>
									<br>
									<?php echo "<span style=\"color:red;\">".Kohana::lang('ui_main.email_example')."</span>"; ?>
								</small> 
							</label>
							<span><?php print form::input('alert_email', $form['alert_email'], ' title="'.Kohana::lang('ui_main.email_example').'" class="text long texthint"'); ?></span>
						</div>
					</div>
					<!--div class="box"> 
						<label>
							<?php
							//print form::checkbox('alert_unsuscribe', '1', false);
							?>
							<span><strong><?php //echo Kohana::lang('ui_main.unsubscribe_link'); ?></strong></span>
						</label>
					</div-->
				</div>
				<div class="step-3">
					<span class="floating-dropcap">3</span>
					<h2><?php echo Kohana::lang('ui_main.alerts_step3_select_categories'); ?></h2>
					<div class="holder">
						<div class="box">
							<div class="report_category" id="categories">
							<?php
								$selected_categories = array();
								if (!empty($form['alert_category']) && is_array($form['alert_category'])) 
								{
									$selected_categories = $form['alert_category'];
								}
								echo category::tree($categories, $selected_categories, 'alert_category', 2, false);
							?>
							</div>
						</div>
					</div>
					<!--div class="report_row" style="width:350px;padding-left:170px;">
						<input name="submit" type="submit" value="<?php echo Kohana::lang('ui_main.reports_btn_submit'); ?>" class="btn_submit" /> 
					</div-->
				</div>
				
				<div class="report_row" style="width:350px;padding-left:35px;">
					<input name="submit" type="submit" value="<?php echo Kohana::lang('ui_main.subscribe'); ?>" class="btn_submit" style="margin-left:0px;width:390px;"/> 
				</div>
                <br /><br />
				<span class="floating-dropcap">4</span>
                <a id="lnkConfirmPrevious" href="<?php echo url::site().'alerts/confirm';?>">
                    <h2><?php echo Kohana::lang('ui_main.alert_confirm_previous'); ?></h2>
                </a>
				<br />
				<br />


			</div>
			<?php print form::close(); ?>
			<div class="step-2-holder" style="float:right;margin-top:15px;">
				<span class="floating-dropcap">5</span>
				<h2>
					<?php echo Kohana::lang('alerts.unsubscribe_to'); ?>&nbsp;
					<a href="javascript:toggleLayer('unsubscribe_switch_link', 'unsubscribe_switch')" id="unsubscribe_switch_link">
						<?php echo Kohana::lang('ui_main.click'); ?></a>
					</a>
					<br><br><br><br>
				</h2>

				<div  id="unsubscribe_switch" style="background-color:#D3D3D3; width:400px; padding:15px;display:none">
						<?php 
						$arr = "id=unsuscribe";
						print form::open('/alerts/unsubscribe');
						print Kohana::lang('ui_main.alerts_email')."<br><br>".form::input('alert_email', '', ' class="text long"')."<br><br>";
						print Kohana::lang('ui_main.alerts_mobile_phone')."<br><br>".form::input('alert_mobile', $form['alert_mobile'], ' class="text long"')."<br>";
						print form::submit('button', Kohana::lang('alerts.unsubscribe_link'), ' class="btn_submit" style="background-color:#D3D3D3;" ' ,'id="unsubscribe"');
						print form::close();
						?>
				</div>
				<small>
					<br>
					<?php echo "<span style=\"color:red;\">(1) ".Kohana::lang('ui_main.warning')."</span>"; ?>
				</small> 

			</div>	
 		</div>
		<!-- end block -->
	</div>
</div>